<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<html>
<head>
    <title>中奖记录列表</title>
    <%@include file="common/include.jsp" %>
    <style type="text/css">
    	.thclass{
    	 width:18%;
    	}
    	#operation{
    		width:60px;
    	}
    	
    	#goPrizeList{
    		position: absolute;
    		left: 600px;
    		top: 50px;
    	}
    	
    </style>
    
    
    
</head>
<body>
<div class="container">
    <div class="row">
        <div class="col-lg-8">
            <br/>
            <div id = "goPrizeList">
            	<button type="button" onclick="goPrizeList()" class="btn btn-default">奖品列表</button>
            </div>
            <div class="panel panel-default">
                <div class="panel-body">
                	<h3 style="color:gay; font-family:"SimHei";">
						中奖记录列表
					</h3>
                </div>
                <table class="table table-bordered">
                    <thead>
                    <tr>
                    	<th class = "thclass">奖品类型</th>
                    	<th class = "thclass">奖品名称</th>
                        <th class = "thclass">兑奖码</th>
                        <th class = "thclass">用户ID</th>
                        <th class = "thclass">中奖时间</th>
                        <th class = "thclass">状态</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach var="prizeRecord" items="${prizeRecordList}">
                        <tr>
                            <td>${prizeRecord.desc}</td>
                            <td>${prizeRecord.name}</td>
                            <td>${prizeRecord.id}</td>
                             <td>${prizeRecord.openId}</td>
                             <td>${prizeRecord.prizetime}</td>
                             <c:if test="${prizeRecord.isExchange == 400}">
                              	<td>未领取</td>
                             </c:if>
                              <c:if test="${prizeRecord.isExchange == 401}">
                              	<td>已领取</td>
                             </c:if>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<script>
    function goPrizeList() {
    	window.location.href = '${ctx}/prize/listPrize';
	}
</script>
</body>
</html>
